home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
progs
/
editor
/
frexxed
/
fpl
/
multiblock.fpl
< prev
next >
Wrap
Text File
|
1995-07-18
|
925b
|
54 lines
export int PasteFromBlock()
{
string key;
int id;
Status(0, "Press key to get block!");
key = GetKey();
if(!strcmp("\x1b", key)) {
/* escape was pressed! */
ReturnStatus("Aborted...");
}
id = GetBufferID(sprintf("MultiBlock_%s", key));
if(id) {
BlockPaste(id);
}
}
export int CopyToNewBlock()
{
string key;
string blockname;
int id;
int ourid = GetEntryID();
Status(0, "Press a key to name the block!");
key = GetKey();
if(!strcmp("\x1b", key)) {
/* escape was pressed! */
ReturnStatus("Aborted...");
}
Visible(0);
blockname = sprintf("MultiBlock_%s", key);
id = GetBufferID(blockname);
if(!id) {
/* there is no such block! */
id = BlockCreate(blockname);
}
else {
Clear(id);
}
CurrentBuffer(id);
BlockPaste();
CurrentBuffer(ourid);
}
AssignKey("CopyToNewBlock();", "amiga t c");
AssignKey("PasteFromBlock();", "amiga t p");